#include "wxstool.h"

#include "wxsitemresdata.h"
#include <logmanager.h>

wxsTool::wxsTool(
  wxsItemResData* Data,
  const wxsItemInfo* Info,
  const wxsEventDesc* EventArray,
  const wxsStyleSet* StyleSet,
  long PropertiesFlags ):
  wxsParent( Data, Info, PropertiesFlags, EventArray, StyleSet ) {
}

bool wxsTool::OnCanAddToResource( wxsItemResData* Data, bool ShowMessage ) {
  if( GetInfo().AllowInXRC ) {
    return true;
  }
  switch( Data->GetPropertiesFilter() & ( flSource | flMixed | flFile ) ) {
    case flSource:
      return true;
    case flMixed:
    case flFile:
      if( ShowMessage ) {
        msging( F( _T( "%s 不支持XRC" ), GetInfo().ClassName.c_str() ), _T( "刀具插入误差" ) );
      }
      return false;
    default:
      break;
  }
  return false;
}

void wxsTool::OnEnumItemProperties( long Flags ) {
  OnEnumToolProperties( Flags );
}

void wxsTool::OnAddItemQPP( wxsAdvQPP* QPP ) {
  OnAddToolQPP( QPP );
}
